package com.ruoyi.system.domain.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 枚举聚合VO（前端下拉框/状态展示用）
 */
@Data
@ApiModel(value = "EnumAggregationVo", description = "枚举聚合VO（包含所有业务枚举的code和desc）")
public class EnumAggregationVo {

    @ApiModelProperty(value = "枚举类型列表")
    private List<EnumTypeVo> enumTypes;

    /**
     * 单个枚举类型VO
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(value = "EnumTypeVo", description = "单个枚举类型的详细信息")
    public static class EnumTypeVo {
        @ApiModelProperty(value = "枚举类型标识（与实体类字段名对应，如useUnit、materialCategory）", example = "useUnit")
        private String typeKey;

        @ApiModelProperty(value = "枚举类型描述（中文名称）", example = "使用单位")
        private String typeDesc;

        @ApiModelProperty(value = "该类型下的所有枚举项")
        private List<EnumItemVo> items;
    }

    /**
     * 枚举项VO（包含code和desc）
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(value = "EnumItemVo", description = "枚举项（包含编码和描述）")
    public static class EnumItemVo {
        @ApiModelProperty(value = "枚举编码（数据库存储值）", example = "1")
        private Integer code;

        @ApiModelProperty(value = "枚举描述（前端展示值）", example = "平方")
        private String desc;
    }
}
